﻿using JustinAngel.UnitedNationsNews.Framework;
using JustinAngel.UnitedNationsNews.Pages.Article;
using JustinAngel.UnitedNationsNews.Pages.ArticleList;
using JustinAngel.UnitedNationsNews.Pages.Main;
using JustinAngel.UnitedNationsNews.Pages.Photos;
using JustinAngel.UnitedNationsNews.Pages.Video;
using JustinAngel.UnitedNationsNews.Pages.WebBrowser;

namespace JustinAngel.UnitedNationsNews.AppCore
{
    public class ViewModelLocator
    {
        public static MainPageViewModel _MainPageViewModel;
        public MainPageViewModel MainPageViewModel
        {
            get
            {
                if (_MainPageViewModel == null)
                    _MainPageViewModel = IoC.Get<MainPageViewModel>();
                return _MainPageViewModel;
            }
            set { _MainPageViewModel = value; }
        }

        public static ArticlePageViewModel _ArticlePageViewModel;
        public ArticlePageViewModel ArticlePageViewModel
        {
            get
            {
                if (_ArticlePageViewModel == null)
                    _ArticlePageViewModel = IoC.Get<ArticlePageViewModel>();
                return _ArticlePageViewModel;
            }
            set { _ArticlePageViewModel = value; }
        }

        public static ArticleListViewModel _ArticleListViewModel;
        public ArticleListViewModel ArticleListViewModel
        {
            get
            {
                if (_ArticleListViewModel == null)
                    _ArticleListViewModel = IoC.Get<ArticleListViewModel>();
                return _ArticleListViewModel;
            }
            set { _ArticleListViewModel = value; }
        }

        public static PhotosViewModel _PhotosViewModel;
        public PhotosViewModel PhotosViewModel
        {
            get
            {
                if (_PhotosViewModel == null)
                    _PhotosViewModel = IoC.Get<PhotosViewModel>();
                return _PhotosViewModel;
            }
            set { _PhotosViewModel = value; }
        }

        public static VideoAndRadioViewModel _VideoAndRadioViewModel;
        public VideoAndRadioViewModel VideoAndRadioViewModel
        {
            get
            {
                if (_VideoAndRadioViewModel == null)
                    _VideoAndRadioViewModel = IoC.Get<VideoAndRadioViewModel>();
                return _VideoAndRadioViewModel;
            }
            set { _VideoAndRadioViewModel = value; }
        }

        public static WebBrowserViewModel _WebBrowserViewModel;
        public WebBrowserViewModel WebBrowserViewModel
        {
            get
            {
                if (_WebBrowserViewModel == null)
                    _WebBrowserViewModel = IoC.Get<WebBrowserViewModel>();
                return _WebBrowserViewModel;
            }
            set { _WebBrowserViewModel = value; }
        }
    }
}
